/**
* controller.js 
*/
(function($j) {
	// api calls
	$j.extend(s, {
		// Get the JSON of search
		addItemFromFile: function(callback) {	
			 var params = $j.extend({
				 type: "GET",
				 url: "/ebay/addItemFromFile/ers?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				 dataType: "json",
				 accept: "application/json",
				 contentType: "application/json"
			 }, callback);			
			$j.ajax(params);
		},
		addItemData: function(criteria, callback) {	
			 var params = $j.extend({
				 type: "POST",
				 data: JSON.stringify(criteria),
				 url: "/ebay/addItemDataContent?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				 dataType: "json",
				 accept: "application/json",
				 contentType: "application/json"
			 }, callback);			
			$j.ajax(params);
		},
		uploadFiles:function(pathvalue,callback){
			
			
			
		},
		getUploadfiles: function(pathvalue, callback) {	
			 var params = $j.extend({
				 type: "GET",
				 url: "/ebay/uploadFiles/"+pathvalue+"?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				 dataType: "json"
			 }, callback);			
			$j.ajax(params);
		},
		addItemDataDetails: function(itemNamw,ItemCode, ItemId, callback) {	
			 var params = $j.extend({
				 type: "GET",
				 url: "/ebay/AddItemData/"+itemNamw+"/"+ItemCode+"/"+ItemId+ "?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				 dataType: "json"
			 }, callback);			
			$j.ajax(params);
		},
		itemDataList: function(callback) {	
			var params = $j.extend({
				type: "GET",
				url: "/ebay/itemDataList?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				dataType: "json"
			}, callback);			
			$j.ajax(params);
		},
		deleteItem: function(itemId, callback) {	
			 var params = $j.extend({
				 type: "GET",
				 url: "/ebay/deleteItem/"+itemId+ "?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				 dataType: "json"
			 }, callback);			
			$j.ajax(params);
		},
		searchItemsData: function(searchKeyword, callback) {	
			 var params = $j.extend({
				 type: "GET",
				 url: "/ebay/searchItemsData/"+searchKeyword+ "?random=" + Math.floor(Math.random() * (new Date()).getTime() + 1),
				 dataType: "json"
			 }, callback);			
			$j.ajax(params);
		},
		
		});	
})(jQuery);


